<?php

/**
 * StormTrack filter form base class.
 *
 * @package    TMD
 * @subpackage filter
 * @author     Thaihosting
 */
abstract class BaseStormTrackFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'ISPEED'            => new sfWidgetFormFilterInput(),
      'ILEVEL'            => new sfWidgetFormFilterInput(),
      'ILATITUDE_DEGREE'  => new sfWidgetFormFilterInput(),
      'ILATITUDE_MINUTE'  => new sfWidgetFormFilterInput(),
      'ILATITUDE_SECOND'  => new sfWidgetFormFilterInput(),
      'ILONGITUDE_DEGREE' => new sfWidgetFormFilterInput(),
      'ILONGITUDE_MINUTE' => new sfWidgetFormFilterInput(),
      'ILONGITUDE_SECOND' => new sfWidgetFormFilterInput(),
      'SDOC_LINK'         => new sfWidgetFormFilterInput(),
      'IUSER_ID'          => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'ISPEED'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ILEVEL'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ILATITUDE_DEGREE'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ILATITUDE_MINUTE'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ILATITUDE_SECOND'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ILONGITUDE_DEGREE' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ILONGITUDE_MINUTE' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ILONGITUDE_SECOND' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'SDOC_LINK'         => new sfValidatorPass(array('required' => false)),
      'IUSER_ID'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('storm_track_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'StormTrack';
  }

  public function getFields()
  {
    return array(
      'ISTORM_ID'         => 'Number',
      'DTTIME'            => 'Date',
      'ISPEED'            => 'Number',
      'ILEVEL'            => 'Number',
      'ILATITUDE_DEGREE'  => 'Number',
      'ILATITUDE_MINUTE'  => 'Number',
      'ILATITUDE_SECOND'  => 'Number',
      'ILONGITUDE_DEGREE' => 'Number',
      'ILONGITUDE_MINUTE' => 'Number',
      'ILONGITUDE_SECOND' => 'Number',
      'SDOC_LINK'         => 'Text',
      'IUSER_ID'          => 'Number',
    );
  }
}
